package com.wx.fresh.user.mapper;

import com.wx.fresh.common.pojo.CUser;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author Dshzs月
 * @version 1.0.0
 * @ClassName CustomUserMapper.java
 * @Description TODO
 * @createTime 2022年04月27日 10:37:00
 */
@Mapper
public interface CustomUserMapper1 {

    @Select("select * from xwrs_user")
    List<CUser> findAll();

    @Select("select user_id from xwrs_user where username=#{username} and password=#{password}")
    CUser findByUsernameAndPassword(CUser cUser);

    @Insert("INSERT INTO `xwrs`.`xwrs_user`(`user_id`, `username`, `password`, `phone`, `birth`, `nikename`,`sex`, `create_user`, `update_user`) VALUES" +
            "(#{userId},#{username},#{password},#{phone},#{birth},#{nikename},#{sex},#{createUser},#{updateUser})")
    int save(CUser cUser);
}
